package org.bbl.db.mybatis.mysql;

import com.google.inject.ImplementedBy;
import org.bbl.db.mybatis.mapper.BaseMapper;

import java.util.List;

/**
 * @author biniamg
 * @since 11/16/12
 */
@ImplementedBy(MyEntityResolverImpl.class)
public interface MyEntityResolver {
    <T> List<T> findAll(Class<? extends BaseMapper<T>> clazz);

    <T> T findById(Class<? extends BaseMapper<T>> clazz, int... id);

    <T> List<T> findAll(Class<? extends BaseMapper<T>> clazz, String tableName);

    <T> List<T> findByParentId(Class<? extends BaseMapper<T>> clazz, int projectId);

    <T> List<T> findByKeyId(Class<? extends BaseMapper<T>> clazz, String language, int bookId, int chapterId);

    <T> List<T> findByLike(Class<? extends BaseMapper<T>> clazz, String language, int bookIdS, int bookIdE, String key);

    <T> List<T> findByApproximation(Class<? extends BaseMapper<T>> clazz,
                                    String table1, String table2,
                                    int bookIdS, int bookIdE, String key1, String key2);

    <T> void delete(Class<? extends BaseMapper<T>> clazz, int languageId);

    void truncate(String tableName);

    <T> void insert(Class<? extends BaseMapper<T>> clazz, T wordList);

    <T> void insertDynamicTable(Class<? extends BaseMapper<T>> clazz, String param1, T wordList);

    <T> List<T> findLinking(Class<? extends BaseMapper<T>> clazz, String param1, int param2, int param3, int param4);

    List<Integer> search(String param1, int param2, int param3, int param4, String param5);

    <T> T findByIdentifier(Class<? extends BaseMapper<T>> clazz, int languageId, String identifier);

    <T> List<T> findMySibling(Class<? extends BaseMapper<T>> clazz, int languageId, String identifier);


}
